<?php
namespace app\common\controller;
use app\common\model\Api as ApiModel;
/**
 * Description of ApiUser
 * 修正数据-弃用
 * @author 高磊<1455209597@qq.com>
 */
class ApiUser extends Api{
   
    protected $userInfo;    //用户名称
    
    function __construct(){       
       parent::__construct();
       //检查用户是否可接入
        if (!$this->checkAuthor($this->header)) {   
            exit(Apiback($this->result=msback(100,'非法设备请求',[])));
        }
        $this->userInfo= ApiModel::getUserInfo($this->header['userToken']);
   }
       
   /**
    * 校验用户信息
    */
    protected function checkAuthor($header) {
       if(!empty($header['userToken'])){
           return ApiModel::checkUserToken($header['userToken']);
       }
       RETURN false;
    }
}
